﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="web.ClientMgr.WebForm1" %>

<%@ Register assembly="PmsClient" namespace="PmsClient" tagprefix="UserControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <script type="text/javascript">
    
      function pageLoad() {
      }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="RelaTypeID" DataSourceID="SqlDataSource1" EmptyDataText="没有记录">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:TemplateField HeaderText="RelaTypeID" InsertVisible="False" 
                    SortExpression="RelaTypeID">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("RelaTypeID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("RelaTypeID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="RelaTypeNO" SortExpression="RelaTypeNO">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RelaTypeNO") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("RelaTypeNO") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="RelaTypeName" SortExpression="RelaTypeName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("RelaTypeName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("RelaTypeName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ClientID" SortExpression="ClientID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ClientID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("ClientID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:pmsConnectionString %>" 
            DeleteCommand="DELETE FROM [ClientOfClientDetailRelaType] WHERE [RelaTypeID] = @RelaTypeID" 
            InsertCommand="INSERT INTO [ClientOfClientDetailRelaType] ([RelaTypeNO], [RelaTypeName], [ClientID]) VALUES (@RelaTypeNO, @RelaTypeName, @ClientID)" 
            SelectCommand="SELECT [RelaTypeID], [RelaTypeNO], [RelaTypeName], [ClientID] FROM [ClientOfClientDetailRelaType] WHERE ([ClientID] = @ClientID)" 
            UpdateCommand="UPDATE [ClientOfClientDetailRelaType] SET [RelaTypeNO] = @RelaTypeNO, [RelaTypeName] = @RelaTypeName, [ClientID] = @ClientID WHERE [RelaTypeID] = @RelaTypeID">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="ClientID" PropertyName="Text" 
                    Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="RelaTypeID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="RelaTypeNO" Type="String" />
                <asp:Parameter Name="RelaTypeName" Type="String" />
                <asp:Parameter Name="ClientID" Type="Int32" />
                <asp:Parameter Name="RelaTypeID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="RelaTypeNO" Type="String" />
                <asp:Parameter Name="RelaTypeName" Type="String" />
                <asp:Parameter Name="ClientID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <UserControl:DropDownListBox ID="DropDownListBox1" runat="server">
        </UserControl:DropDownListBox>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
    </div>
    </form>
</body>
</html>
